#include "FileDataSource.h"
#include <assert.h>


FileDataSource::FileDataSource(char const* fileName)
{
	f = fopen(fileName, "rb");
	assert(NULL != f);
	nextByte = fgetc(f);
}


FileDataSource::~FileDataSource(void)
{
	fclose(f);
}

uint8_t  FileDataSource::getNextByte()
{
	assert(EOF != nextByte);
	uint8_t res = nextByte;
	nextByte = fgetc(f);
	return res;
}

bool FileDataSource::hasNextByte()
{
	return EOF != nextByte;
}
